package cannot.shiro;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
public class ShiroUtil {
	
	public static String getUserByPrincipal(){
		Subject subject = SecurityUtils.getSubject();
		if(subject.getPrincipal()!=null){
			return subject.getPrincipal().toString();
		}
		return null;
	}
	
	
}
